<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header','admin');
?>
<script type="text/javascript">
<!--
	$(function(){
		$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'}, function(){this.close();$(obj).focus();})}});
		$("#title").formValidator({onshow:"<?php echo L("input").L('reg_title')?>",onfocus:"<?php echo L("input").L('reg_title')?>",oncorrect:"<?php echo L('input_right');?>"}).inputValidator({min:1,onerror:"<?php echo L("input").L('reg_title')?>"});
    $('#source_type').formValidator({onshow:"请选择类型",onfocus:"请选择类型",oncorrect:"<?php echo L('right_all')?>"}).inputValidator({min:1,onerror:"请选择类型"});
    $('#contest_district').formValidator({onshow:"请选择赛区",onfocus:"请选择赛区",oncorrect:"<?php echo L('right_all')?>"}).inputValidator({min:1,onerror:"请选择赛区"});		
	})
//-->
</script>
<div class="pad-lr-10">
<form action="?m=sign_up&c=reg&a=add" method="post" id="myform">
	<table width="100%"  class="table_form">
  <tr>
    <th width="120"><?php echo L('reg_title')?>：</th>
    <td class="y-bg"><input type="text" class="input-text" name="reg[title]" id="title" size="30" /></td>
  </tr>
  <tr>
    <th><?php echo L('reg_title_image')?>：</th>
    <td class="y-bg"><?php echo form::images('reg[title_image]', 'title_image', '', 'subject', '', 30)?></td>
  </tr>
  <tr>
    <th><?php echo L('source_type')?>：</th>
    <td class="y-bg">
    	<?php echo form::select($reg_type, $id = 0, $str = ' name="reg[source_type]" id="source_type" ', '请选择')?>
    </td>
  </tr>
  <!-- <tr id="reg_contest" style="display:none;">
    <th><?php echo L('reg_contest')?>：</th>
    <td class="y-bg">
    	<select name="contestid" >
			<option value="0">请选择</option>
			<?php echo $categorys;?>
		</select>
    </td>
  </tr>
  <tr id="reg_train" style="display:none;">
    <th><?php echo L('reg_train')?>：</th>
    <td class="y-bg">
    	<select name="courseid" >
			<option value="0">请选择</option>
			<?php foreach ($course_list as $v) {?>
			<option value="<?=$v['id']?>"><?=$v['name']?></option>
			<?php }?>
		</select>
    </td>
  </tr> -->
  <tr>
    <th>赛区：</th>
    <td class="y-bg">
      <?php echo form::select($contest_district, $id = 0, $str = ' name="reg[contest_district]" id="contest_district" ', '请选择')?>
    </td>
  </tr>
  <tr>
    <th><?php echo L('info_description')?>：</th>
    <td class="y-bg"><textarea name="reg[info_description]" cols="60" rows="10" ></textarea></td>
  </tr>
</table>
<div class="bk15"></div>
    <input type="submit" class="dialog" id="dosubmit" name="dosubmit" value="<?php echo L('submit');?>" />
</form>
</div>
<script language="JavaScript">
<!--
	// $("#source_type").change(function() {
	// 	var source_type = $(this).val();
	// 	if (!source_type) {
	// 		$("#reg_contest").hide();
	// 		$("#reg_train").hide();
	// 	} else if(source_type == 1) {
	// 		$("#reg_contest").show();
	// 		$("#reg_train").hide();
	// 	} else if(source_type == 2) {
	// 		$("#reg_contest").hide();
	// 		$("#reg_train").show();
	// 	}
	// })
	//-->
</script>
</body>
</html>